/*

 Copyright (C) 2009-2011 Oleksandr Natalenko aka post-factum

 This program is free software; you can redistribute it and/or modify
 it under the terms of the Universal Program License as published by
 Oleksandr Natalenko aka post-factum; see file COPYING for details.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 You should have received a copy of the Universal Program
 License along with this program; if not, write to
 pfactum@gmail.com

*/

package helper;

import helper.BinaryNumber;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Oleksandr Natalenko aka post-factum
 */
public class Rectifier {
    /**
     * Runs rectifying bits
     *
     * @return flat boolean array
     */
    public static List<Boolean> getBits(List<BinaryNumber> sequence) {
        List<Boolean> linearSequence = new ArrayList<Boolean>();
        //forms linear bit array
        for (BinaryNumber bn : sequence)
            for (int i = 0; i < bn.getLength(); i++)
                linearSequence.add(bn.getDigit(i));
        return linearSequence;
    }

}
